Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix createchildusergroup #11

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

joramwangi
Copy link

Sorry about the whitespace. main change was

public virtual UsersGroup CreateChildUserGroupOf(string parentGroupName, string usersGroupName)
     {
       UsersGroup parent = GetUsersGroupByName(parentGroupName);
       Guard.Against<ArgumentException>(parent == null,
                                        "Parent users group '" + parentGroupName + "' does not exists");

       UsersGroup group = CreateUsersGroup(usersGroupName);
       group.Parent = parent;
       group.AllParents.AddAll(parent.AllParents);
       group.AllParents.Add(parent);
       parent.DirectChildren.Add(group);
-      parent.AllChildren.Add(group);
+            foreach(UsersGroup prnt in group.AllParents)
+            {
+                prnt.AllChildren.Add(group);
+            }
+
         return group; 
     } 

Initially only direct children were being added and thus if in a nested scenario group.AllChildren will only return direct children unlike group.AllParents

@nrstott
Copy link

nrstott commented Sep 8, 2013

Can you resolve the conflicts first please? I'm not in a good position to resolve them as I have not worked with this code base in a while. Thanks for the work though! I'll be happy to merge when you resolve the conflicts.

@joramwangi
Copy link
Author

All tests pass except for RemovingUserFromGroupInvalidatesSecondLevelCache()

whyer added a commit to whyer/rhino-security that referenced this pull request Jan 8, 2020
This implements another way of adding the security enhancements to a Linq query.

This is a cherry-pick of PR hibernating-rhinos#11 on ayende/rhino-security on GitHub
(ayende#11)

After some evaluation I went for Mark Junkers implementation because
it did not depend on LinkKit. Even though I think my implementation
is cleaner and much easier to understand.

I think that a library of this kind should be really easy to use in
an solution and to minimize external dependencies is a worth alot.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants